import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'dart:async';
import 'dart:async';
import 'dart:async';

class StepperDemo extends StatefulWidget {
  @override
  _StepperDemoState createState() => _StepperDemoState();
}

enum Action { OK, CANCEL }

class _StepperDemoState extends State<StepperDemo> {
  int _currentStep=0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('StepperDemo1'),
        elevation: 0,
      ),
      body: Container(

        padding: EdgeInsets.all(16),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Theme(
              data: Theme.of(context).copyWith(primaryColor: Colors.black),
              child: Stepper(
                currentStep: _currentStep,
                onStepTapped: (value){
                  setState(() {
                    _currentStep=value;
                  });
                },

                onStepContinue: (){
                  setState(() {
                    _currentStep<2?_currentStep+=1:_currentStep=0;

                  });
                },
                onStepCancel: (){
                  setState(() {
                    _currentStep>0?_currentStep-=1:_currentStep=0;
                  });
                },
                steps: [
                  Step(
                    title: Text('login'),
                    subtitle: Text('login first'),
                    content: Text('magna exeritation'),
                    isActive: _currentStep==0,
                  ),
                  Step(
                    title: Text('login2'),
                    subtitle: Text('login first'),
                    content: Text('magna exeritation'),
                    isActive: _currentStep==1,
                  ),
                  Step(
                    title: Text('login3'),
                    subtitle: Text('login first'),
                    content: Text('magna exeritation'),
                    isActive: _currentStep==2,
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
